<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/6
 * Time: 20:55
 */
error_reporting(E_ALL || ~E_NOTICE); //显示除去 E_NOTICE 之外的所有错误信息
require_once "../config/config.php";
require_once "../model/adminDb.php";
$adminDb = new adminDb();
$data = $_POST['data'];
$platfrom = $_POST['platfrom'];
$product = $data['product'];
$person = $data['person'];
$title = $data['title'];

$content = $data['content'];
$newName = $data['new_name'];
$version = $data['version'];
$addtime = time();
$status = 0;


$addData = $adminDb->add_bug($product, $platfrom, $person, $title, $content, $newName, $status, $version, $addtime);
try {
    if ($addData) {
        $dat = array(
            'message' => "添加成功",
            "code" => 200,
            "content"=>$content
        );
        echo json_encode($dat);
    } else {
        $dat = array(
            "code" => 404,
            'message' => "添加失败",
        );
        echo json_encode($dat);
    }
} catch (Exception $e) {

    // 回滚事务
    // $pdo->rollback();
    echo $e->getMessage();
}













